//
//  ThirdViewController.m
//  真·豆瓣半完全体
//
//  Created by dllo on 15/12/31.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "ThirdViewController.h"
#import "MyTableViewCell2.h"
#import "UIImageView+WebCache.h"
@interface ThirdViewController ()<UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) NSMutableArray *arrData;

@end

@implementation ThirdViewController
- (void)dealloc{
    [super dealloc];
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [ UIColor whiteColor];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:84/255.0 green:139/255.0 blue:156/255.0 alpha:1];
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.title = @"影院";
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 375, 554) style:UITableViewStylePlain];
    [self.view addSubview:_tableView];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    [_tableView release];
    
    
    [self dataHandle];
    [_tableView registerClass:[MyTableViewCell2 class] forCellReuseIdentifier:@"cell"];
}
- (NSInteger )tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return _arrData.count;
}
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 200;
}
- (UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    MyTableViewCell2 *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    
    cell.imgView.image = [UIImage imageNamed:[NSString stringWithFormat:@"bg_eventlistcell@2x.png"]];
    cell.myLabel.text = [NSString stringWithFormat:@"%@", [_arrData[indexPath.row] objectForKey:@"cinemaName"]];
    cell.myLabel2.text = [NSString stringWithFormat:@"%@", [_arrData[indexPath.row] objectForKey:@"address"]];
    cell.myLabel2.numberOfLines = 2;
    cell.myLabel3.text = [NSString stringWithFormat:@"%@", [_arrData[indexPath.row] objectForKey:@"telephone"]];

    
    return cell;
}







- (void)dataHandle{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"cinema" ofType:@"plist"];
    self.arrData = [NSMutableArray arrayWithContentsOfFile:path];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
